home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / win_sbar.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  2KB  |  79 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  WIN_SBAR.H - MS-Windows Scroll Bar Control Class
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              95/02/05 - Version 1.02A release.
  10. //              95/07/21 - Version 1.02B release.
  11. //              96/02/14 - Version 1.02C release.
  12. //              96/04/01 - Version 1.03A release.
  13. //
  14. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  15. //              Borland C++ Version 4.5
  16. //
  17. //  Author:     Ian Ashdown, P.Eng.
  18. //              byHeart Software Limited
  19. //              620 Ballantree Road
  20. //              West Vancouver, B.C.
  21. //              Canada V7S 1W3
  22. //              Tel. (604) 922-6148
  23. //              Fax. (604) 987-7621
  24. //
  25. //  Copyright 1994-1996 byHeart Software Limited
  26. //
  27. //  The following source code has been derived from:
  28. //
  29. //    Ashdown, I. 1994. Radiosity: A Programmer's
  30. //    Perspective. New York, NY: John Wiley & Sons.
  31. //
  32. //  It may be freely copied, redistributed, and/or modified
  33. //  for personal use ONLY, as long as the copyright notice
  34. //  is included with all source code files.
  35. //
  36. ////////////////////////////////////////////////////////////
  37.  
  38. #ifndef _WIN_SBAR_H
  39. #define _WIN_SBAR_H
  40.  
  41. #include "general.h"
  42.  
  43. class WinScroll         // Scroll bar control
  44. {
  45.   private:
  46.     HWND hwnd;          // Client window handle
  47.     POINT curr_pos;     // Current scroll position
  48.     POINT max_range;    // Maximum scroll range
  49.     POINT inc;          // Scroll increment
  50.     POINT size;         // Client window size
  51.  
  52.   public:
  53.     WinScroll( HWND hw)
  54.     {
  55.       RECT rect;        // Rectangle structure
  56.  
  57.       curr_pos.x = curr_pos.y = 0;
  58.       max_range.x = max_range.y = 0;
  59.       inc.x = inc.y = 0;
  60.  
  61.       hwnd = hw;
  62.       GetClientRect(hwnd, &rect);
  63.       size.x = rect.right;
  64.       size.y = rect.bottom;
  65.  
  66.       Hide();
  67.     }
  68.  
  69.     POINT Pos() { return curr_pos; }
  70.     void Hide();
  71.     void Horz( WPARAM, WORD );
  72.     void Init( int, int );
  73.     void Set( int, int );
  74.     void Vert( WPARAM, WORD );
  75. };
  76.  
  77. #endif
  78.  
  79.